import {createStore} from "vuex";

const store = createStore({
    userInfo:null,
    state: {
        navbarState: true,//顶部导航显示状态
        tabbarState: true,//底部导航显示状态
        tabbarActionName:null,//底部导航选中名称
        navbarType: null,//顶部类型
        navbarTitle: null,//顶部标题
        langState: false,//选择语言弹窗状态
        loadingState: false,//加载
    },
    mutations: {
        setUserInfo(state: any, value: boolean) {
            state.userInfo = value;
        },
        switchNavbarState(state: any, value: boolean) {
            state.navbarState = value;
        },
        switchTabbarState(state: any, value: boolean) {
            state.tabbarState = value;
        },
        switchTabbarActionName(state: any, value: string) {
            state.tabbarActionName = value;
        },
        switchNavbarTitle(state: any, value: string) {
            state.navbarTitle = value;
        },
        switchNavbarType(state: any, value: string) {
            state.navbarType = value;
        },
        switchLangState(state: any, value: string) {
            state.langState = value;
        },
        switchLoadingState(state: any, value: string) {
            state.loadingState = value;
        }
    }
})

export default store;
